#ifndef VOICEUPLOAD_H
#define VOICEUPLOAD_H

#include <QObject>

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QFile>
#include <QFileInfo>
#include <QDesktopServices>
#include <QPicture>
#include <QTime>
#include <QClipboard>
#include <QVector>
#include <QSettings>

#include <QDebug>

namespace VoiceUpload {


class VoiceUpload : public QObject
{
    Q_OBJECT
public:
    explicit VoiceUpload(QObject *parent = 0);
    static VoiceUpload* instance(QObject *parent = 0);

public:
    void upload();
    void parserVoice(QByteArray message);

signals:
    void sendVoiceUrl(QString url);
    void setVoice();

public slots:
    void onUpload();

public:
    void setFileName(QString _filename){fileName = _filename;}
    QString filename(){return fileName;}
private:
    static VoiceUpload *m_instance;
    QString fileName;

    QNetworkAccessManager *http;
    QVector<QNetworkReply *> reps;
    
};

}

#endif // VOICEUPLOAD_H
